package hongcaosp.app.android.modle.bean;

import com.alibaba.fastjson.annotation.JSONField;

import xlj.lib.android.base.utils.DateUtil;

public class DynamicVideo extends Video implements IDynamic {
    @JSONField(name = "videoUserThird")
    private User videoUserThird;

    @JSONField(name = "videosThird")
    private Video videosThird;
    @JSONField(name = "appComments")
    private String appComments;

    public void setVideoUserThird(User videoUserThird) {
        this.videoUserThird = videoUserThird;
    }

    public void setVideosThird(Video videosThird) {
        this.videosThird = videosThird;
    }

    public void setAppComments(String appComments) {
        this.appComments = appComments;
    }

    public User getVideoUserThird() {
        return videoUserThird;
    }

    public Video getVideosThird() {
        return videosThird;
    }

    @Override
    public String getAppComments() {
        return appComments;
    }

    @Override
    public String getUpdateTime() {

        return  DateUtil.getChatTimeStr(getCreateTime());
    }

    @Override
    public String getDescription() {
        return getVideoDesc();
    }

    private float ratio = 0f;
    @Override
    public float getVideoRatio() {
        if (ratio == 0) {
            if (getVideoHeight() == 0 || getVideoWidth() == 0) {
                ratio = (float) (16 / 9.0);
            } else {
                ratio = getVideoHeight() / (float) getVideoWidth();
            }
        }

        return ratio;
    }
}
